const navigateBack = () => {
	const pages = getCurrentPages()
	if (pages.length == 1) {
		reLaunchToHome()
	}
	uni.navigateBack()
}

const navigateToPath = (path) => {
	uni.redirectTo({
		url: path
	})
}

const redirectToToHome = () => {
	uni.redirectTo({
		url: '/pages/tabBar/home'
	})
}

const reLaunchToHome = () => {
	uni.reLaunch({
		url: '/pages/tabBar/home'
	})
}

const navigateToLogin = (pageParams) => {
	uni.navigateTo({
		url: '/pages/others/login?pageParams=' + pageParams
	})
}

const navigateToWishingTree = () => {
	uni.navigateTo({
		url: '/pages/others/wishingTree'
	})
}

const navigateToWishingTreeRecord = () => {
	uni.navigateTo({
		url: '/pages/others/wishingTreeRecord'
	})
}

const navigateToSignIn = () => {
	uni.navigateTo({
		url: '/pages/others/signIn'
	})
}

const navigateToCalendar = () => {
	uni.navigateTo({
		url: '/pages/others/calendar'
	})
}

const navigateToIntegral = () => {
	uni.navigateTo({
		url: '/pages/others/integral'
	})
}

const navigateToSearch = () => {
	uni.navigateTo({
		url: '/pages/others/search'
	})
}

const navigateToUserInfo = () => {
	uni.navigateTo({
		url: '/pages/others/userInfo'
	})
}

const navigateToRecharge = () => {
	uni.navigateTo({
		url: '/pages/others/recharge'
	})
}

const redirectToMy = (pageCurrent) => {
	uni.redirectTo({
		url: '/pages/tabBar/my?pageCurrent=' + pageCurrent
	})
}

const redirectToCreate = () => {
	uni.redirectTo({
		url: '/pages/tabBar/create'
	})
}

const redirectToPeople = () => {
	uni.redirectTo({
		url: '/pages/tabBar/people'
	})
}

const navigateToMemorialHall = (id, pageCurrent) => {
	uni.navigateTo({
		url: '/pages/others/memorialHall?id=' + id + '&pageCurrent=' + pageCurrent
	})
}

const redirectToMemorialHall = (meMemorialId, pageCurrent) => {
	uni.redirectTo({
		url: '/pages/others/memorialHall?id=' + meMemorialId + '&pageCurrent=' + pageCurrent
	})
}

const navigateToMemorialRecord = (meMemorialId, pageCurrent) => {
	uni.navigateTo({
		url: '/pages/others/memorialRecord?meMemorialId=' + meMemorialId + '&pageCurrent=' + pageCurrent
	})
}

const navigateToLighting = (meMemorialId) => {
	uni.navigateTo({
		url: '/pages/others/lighting?meMemorialId=' + meMemorialId
	})
}

const navigateToLightCandle = (meMemorialId) => {
	uni.navigateTo({
		url: '/pages/others/lightCandle?meMemorialId=' + meMemorialId
	})
}

const navigateToLantern = (meMemorialId) => {
	uni.navigateTo({
		url: '/pages/others/lantern?meMemorialId=' + meMemorialId
	})
}

const navigateToSpace = (meMemorialId) => {
	uni.navigateTo({
		url: '/pages/others/space?meMemorialId=' + meMemorialId
	})
}

const navigateToSpaceDetails = (meMemorialId, pageCurrent) => {
	uni.navigateTo({
		url: '/pages/others/spaceDetails?meMemorialId=' + meMemorialId + '&pageCurrent=' + pageCurrent
	})
}

const navigateToLanternRecord = (meMemorialId) => {
	uni.navigateTo({
		url: '/pages/others/lanternRecord?meMemorialId=' + meMemorialId
	})
}

const navigateToSacrificeRecord = (meMemorialId, isUser) => {
	uni.navigateTo({
		url: '/pages/others/sacrificeRecord?meMemorialId=' + meMemorialId + '&isUser=' + isUser
	})
}

const navigateToLightingRecord = (meMemorialId, isUser) => {
	uni.navigateTo({
		url: '/pages/others/lightingRecord?meMemorialId=' + meMemorialId + '&isUser=' + isUser
	})
}

const navigateToCandleLightRecord = (meMemorialId, isUser) => {
	uni.navigateTo({
		url: '/pages/others/candleLightRecord?meMemorialId=' + meMemorialId + '&isUser=' + isUser
	})
}

const navigateToFamily = (meMemorialId) => {
	uni.navigateTo({
		url: '/pages/others/family?meMemorialId=' + meMemorialId
	})
}

const navigateToArticle = (id) => {
	uni.navigateTo({
		url: '/pages/others/article?id=' + id
	})
}

const navigateToLeaveMessage = () => {
	uni.navigateTo({
		url: '/pages/others/leaveMessage'
	})
}

const navigateToTodaySacrifice = () => {
	uni.navigateTo({
		url: '/pages/others/todaySacrifice'
	})
}

const navigateToUpToDateSacrifice = () => {
	uni.navigateTo({
		url: '/pages/others/upToDateSacrifice'
	})
}

const navigateToUpToFeedbackIndex = () => {
	uni.navigateTo({
		url: '/pages/others/helpAndFeedback/feedbackIndex'
	})
}

const navigateToUpToSacrificeSetting = (meMemorialId) => {
	uni.navigateTo({
		url: '/pages/others/sacrificeSetting?meMemorialId=' + meMemorialId
	})
}

const navigateToUpToRechargeRecord = (meMemorialId) => {
	uni.navigateTo({
		url: '/pages/others/rechargeRecord'
	})
}

const navigateToUpToRecommendCreate = () => {
	uni.navigateTo({
		url: '/pages/others/recommend/create'
	})
}

const navigateToUpToInviteCreate = (meMemorialId) => {
	uni.navigateTo({
		url: '/pages/others/invite/create?meMemorialId=' + meMemorialId
	})
}

const navigateToUpToUsageAgreement = () => {
	uni.navigateTo({
		url: '/pages/others/usageAgreement'
	})
}

const navigateToUserHelp = () => {
	uni.navigateTo({
		url: '/pages/others/useHelp'
	})
}

const navigateToArticleForm = (meMemorialId) => {
	uni.navigateTo({
		url: '/pages/others/articleForm?meMemorialId=' + meMemorialId
	})
}

const navigateToArticleList = () => {
	uni.navigateTo({
		url: '/pages/others/articleList'
	})
}

const navigateToAiDialogue = (meMemorialId) => {
	uni.navigateTo({
		url: '/pages/others/aiDialogue?meMemorialId=' + meMemorialId
	})
}

const navigateToAiLogin = (meMemorialId, me, him) => {
	uni.navigateTo({
		url: `/pages/others/aiLogin?meMemorialId=${meMemorialId}&me=${me}&him=${him}`
	})
}

const redirectToAiDialogue = (meMemorialId) => {
	uni.redirectTo({
		url: '/pages/others/aiDialogue?meMemorialId=' + meMemorialId
	})
}

const redirectToAiLogin = (meMemorialId, me, him) => {
	uni.redirectTo({
		url: `/pages/others/aiLogin?meMemorialId=${meMemorialId}&me=${me}&him=${him}`
	})
}

export {
	navigateToPath,
	navigateToSignIn,
	redirectToToHome,
	reLaunchToHome,
	navigateToLogin,
	navigateToCalendar,
	navigateBack,
	navigateToIntegral,
	navigateToSearch,
	navigateToUserInfo,
	navigateToRecharge,
	redirectToMy,
	redirectToCreate,
	redirectToPeople,
	navigateToMemorialHall,
	redirectToMemorialHall,
	navigateToMemorialRecord,
	navigateToLighting,
	navigateToLightCandle,
	navigateToLantern,
	navigateToSpace,
	navigateToSpaceDetails,
	navigateToLanternRecord,
	navigateToSacrificeRecord,
	navigateToLightingRecord,
	navigateToCandleLightRecord,
	navigateToFamily,
	navigateToArticle,
	navigateToLeaveMessage,
	navigateToTodaySacrifice,
	navigateToUpToDateSacrifice,
	navigateToUpToFeedbackIndex,
	navigateToUpToSacrificeSetting,
	navigateToUpToRechargeRecord,
	navigateToUpToRecommendCreate,
	navigateToUpToInviteCreate,
	navigateToUpToUsageAgreement,
	navigateToUserHelp,
	navigateToArticleForm,
	navigateToArticleList,
	navigateToAiDialogue,
	navigateToAiLogin,
	redirectToAiDialogue,
	redirectToAiLogin,
	navigateToWishingTree,
	navigateToWishingTreeRecord,
}